<template>
  <div class="xtx-cart-page">
    <div class="container m-top-20">
      <div class="cart">
        <table>
          <thead>
          <tr>
            <th class="checkbox-col">
               <el-checkbox @change="allCheck" />
            </th>
            <th class="product-info-col">商品信息</th>
            <th class="price-col">单价</th>
            <th class="quantity-col">数量</th>
            <th class="subtotal-col">小计</th>
            <th class="action-col">操作</th>
          </tr>
          </thead>
          <tbody>
          <!-- 表体内容 -->
          </tbody>
        </table>
      </div>
      <!-- 操作栏 -->
      <div class="action">
        <div class="batch">
<!--          共 {{ cartStore.allCount }} 件商品，已选择 {{ cartStore.selectedCount }} 件，商品合计：-->
<!--          <span class="red">¥ {{ cartStore.selectedPrice.toFixed(2) }} </span>-->
        </div>
        <div class="total">
          <el-button size="large" type="primary" @click="$router.push('/checkout')">下单结算</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'CartRoot',
  setup () {
    const allCheck = (selected) => {
      console.log(selected)
    }
    return { allCheck }
  }
}
</script>

<style scoped lang="less">
.xtx-cart-page {
  margin-top: 20px;

  .cart {
    background: #fff;
    color: #666;

    table {
      border-spacing: 0;
      border-collapse: collapse;
      line-height: 24px;
      .checkbox-col {
        width: 120px;
      }

      .product-info-col {
        width: 400px;
      }

      .price-col {
        width: 220px;
      }

      .quantity-col {
        width: 180px;
      }

      .subtotal-col {
        width: 180px;
      }

      .action-col {
        width: 140px;
      }

      th,
      td {
        padding: 10px;
        border-bottom: 1px solid #f5f5f5;

        &:first-child {
          text-align: left;
          padding-left: 30px;
          color: #999;
        }
      }

      th {
        font-size: 16px;
        font-weight: normal;
        line-height: 50px;
      }
    }
  }

  .cart-none {
    text-align: center;
    padding: 120px 0;
    background: #fff;

    p {
      color: #999;
      padding: 20px 0;
    }
  }

  .tc {
    text-align: center;

    a {
      //color: $xtxColor;
    }

    .xtx-numbox {
      margin: 0 auto;
      width: 120px;
    }
  }

  .red {
    //color: $priceColor;
  }

  .green {
    //color: $xtxColor;
  }

  .f16 {
    font-size: 16px;
  }

  .goods {
    display: flex;
    align-items: center;

    img {
      width: 100px;
      height: 100px;
    }

    >div {
      width: 280px;
      font-size: 16px;
      padding-left: 10px;

      .attr {
        font-size: 14px;
        color: #999;
      }
    }
  }

  .action {
    display: flex;
    background: #fff;
    margin-top: 20px;
    height: 80px;
    align-items: center;
    font-size: 16px;
    justify-content: space-between;
    padding: 0 30px;

    .xtx-checkbox {
      color: #999;
    }

    .batch {
      a {
        margin-left: 20px;
      }
    }

    .red {
      font-size: 18px;
      margin-right: 20px;
      font-weight: bold;
    }
  }

  .tit {
    color: #666;
    font-size: 16px;
    font-weight: normal;
    line-height: 50px;
  }

}
</style>
